<template>
    <nav class="flex aic jc-sb pl-15 pr-15">
        <span class="item flex aic" @click="goBack">
            <van-icon name="arrow-left" />
            <span>返回</span>
        </span>
        <span>{{title}}</span>
        <span @click="$emit('clickRight')" class="item">{{rightText}}</span>
    </nav>
</template>

<script>
export default {
    props:['title','rightText'], 
    methods: {
        goBack() {
            this.$router.back();
        }
    }
}
</script>

<style scoped lang="less">
nav {
    height: 45px;
    background: #fff;

    .item {
        width: 80px;

        &:last-child {
            text-align: right;
        }
    }
}
</style>